%{ open Ast %}

%token NUMBER INTCONST NUMTYPE STRTYPE ROWTYPE COLTYPE ADD SUBTRACT MULTIPLY DIVIDE LESSTHAN GREATERTHAN ASSIGN 
%token EQUALS comment SIZE CURRINDEX IF ELSE LEFTPARAN RIGHTPARAN LEFTSQPARAN LEFTPARAN BLOCKBEGIN BLOCKEND LOOP
%token FUNCTION COL_HEADING ROW_HEADING ROW_LIMIT COL_LIMIT ROW_FILTER_CONDITION COL_SORT_INDEX RETURN IDENTIFIER LOGICALOPERATOR 

%left ADD SUBTRACT
%left MULTIPLY DIVIDE

%start expr
%type < Ast.expr> expr

%%

relationalexpression:
  numberexpression RELOP numberexpression{ Binop($1, RELOP, $3) }

relationalexpression:
  relationalexpression RELOP relationalexpression{ Binop($1, LOGICOP, $3) }


numberexpression: 
  IDENTIFIER
  | NUMBER

